package com.hotel.service;

import com.hotel.dao.UserMapper;
import com.hotel.pojo.User;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
@RequiredArgsConstructor
public class UserServiceImpl implements UserService{

        private final UserMapper userMapper;


    @Override
    public List<User> queryAllUsers() {
        return userMapper.queryAllUsers();
    }

    @Override
    public int updatePwd(User user) {
        return userMapper.updatePwd(user) ;
    }

    @Override
    public User findUser(String username, String password) {
        return userMapper.findUser(username,password);
    }

    @Override
    public void addUser(User user) {


        userMapper.addUser(user);

    }
    @Override
    public void deleteUserById(Integer id) {
            userMapper.deleteUserById(id);
    }

    @Override
    public User queryUserById(Integer id) {
        return userMapper.queryUserById(id);
    }

    @Override
    public void updateUserById(User user) {
        userMapper.updateUserById(user);
    }

    @Override
    public User queryUserByUsername(String findByUsername) {
        return userMapper.queryUserByUsername(findByUsername);
    }


}
